<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
    <title>用户管理</title>
    <link href="../lib/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link href="../home/css/useradmin.css" type="text/css" rel="stylesheet" />
    <link type="text/css" href="../home/css/sellsenter.css" rel="stylesheet"/>
    <script src="../lib/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
    <link rel="stylesheet" type="text/css" href="../lib/elementui/1.4.3/theme-default/index.css">
    <script src="../home/js/vue.min.js"></script>
    <script src="../lib/elementui/1.4.3/index.js"></script>
    <script src="../charge/moment.js"></script>
    <style>.center{  max-width: 1250px;}</style>
</head>
<body>
    <div id="noticeAddUpdate">
        <div style="background: #FFFFFF;width: 870px;height:auto;min-height:950px;margin:  auto;padding-top: 30px;margin-bottom: 50px;">
         <h1 id="h1" for="message-text" class="control-label" style="text-align: center;font-size: 20px;margin:20px 0 20px 20px;">{{title}}</h1>
         <form id="form user" class="submit" style="margin: auto;width: 700px;margin-bottom: 20px;" action="" method="get">
             <div id="div4">
                 <span style="color: red;">*</span>信息类型&nbsp;:&nbsp;
                 <input   id="input1" v-model="noticeUnit.ncLabel"style="background-color: #FFFFFF;width: 600px;"  type="text"/>
                 <!--<img id="img-icon1-11" src="../lib/images/icon-1.png"><img id="img-icon1-12" src="../lib/images/icon-2.png">
                 <span id="tab3-1"></span>-->
             </div>
             <div style="margin-top: 35px;">
                 <span style="color: red">*</span>信息标题&nbsp;:&nbsp;
                 <input   id="input2" v-model="noticeUnit.name"  type="text" style="width: 600px;"  />
                 <!--<img id="img-icon2-11" src="../lib/images/icon-1.png"><img id="img-icon2-12" src="../lib/images/icon-2.png">
                 <span id="tab3-2"></span>-->
             </div>
             <div style="margin-top: 35px;">
                 <template>
                     <div class="block">
                         <span class="demonstration" style="color: red" >*</span>开始时间&nbsp;:&nbsp;
                         <el-date-picker v-model="noticeUnit.startTime" type="datetime" placeholder="选择日期时间">
                         </el-date-picker>
                     </div>
                 </template>
                 <!--<img id="img-icon3-11" src="../lib/images/icon-1.png"><img id="img-icon3-12" src="../lib/images/icon-2.png">
                 <span id="tab3-3"></span>-->
             </div>
             <div style="margin-top:35px;">
                 <template>
                     <div class="block">
                         <span class="demonstration"  style="color: red" >*</span>结束时间&nbsp;:&nbsp;
                         <el-date-picker v-model="noticeUnit.overTime" type="datetime" placeholder="选择日期时间">
                         </el-date-picker>
                     </div>
                 </template>
                <!-- <img id="img-icon4-11" src="../lib/images/icon-1.png"><img id="img-icon4-12" src="../lib/images/icon-2.png">
                 <span id="tab3-4"></span>-->
             </div>
             <div style="margin-top:35px;">
                 <span style="color: red">*</span>内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容&nbsp;:&nbsp;
                 <div id="editor" type="text/plain" style="height:300px;width: 600px;float: right;" ></div>
             </div>
             <div class="clear"></div>
             <div id="div5"  align="center">
                 <div class="am-btn  am-btn-warning am-round " :plain="true"  v-on:click="onSubmit();" data-dismiss="modal"><span id="Noticing">{{button}}</span></div>
             </div>
         </form>
        </div>
    </div>
    <script type="text/javascript" src="../charge/noticeAddUpdate.js"></script>
    <script type="text/javascript">

        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        var ue = UE.getEditor('editor');


        function isFocus(e) {
            alert(UE.getEditor('editor').isFocus());
            UE.dom.domUtils.preventDefault(e)
        }

        function setblur(e) {
            UE.getEditor('editor').blur();
            UE.dom.domUtils.preventDefault(e)
        }

        function insertHtml() {
            var value = prompt('插入html代码', '');
            UE.getEditor('editor').execCommand('insertHtml', value)
        }

        function createEditor() {
            enableBtn();
            UE.getEditor('editor');
        }

        function getAllHtml() {
            alert(UE.getEditor('editor').getAllHtml())
        }

        function getContent() {
            var arr = [];
            arr.push("使用editor.getContent()方法可以获得编辑器的内容");
            arr.push("内容为：");
            arr.push(UE.getEditor('editor').getContent());
            alert(arr.join("\n"));
        }

        function getPlainTxt() {
            var arr = [];
            arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
            arr.push("内容为：");
            arr.push(UE.getEditor('editor').getPlainTxt());
            alert(arr.join('\n'))
        }

        function setContent(isAppendTo) {
            var arr = [];
            arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
            UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
            alert(arr.join("\n"));
        }

        function setDisabled() {
            UE.getEditor('editor').setDisabled('fullscreen');
            disableBtn("enable");
        }

        function setEnabled() {
            UE.getEditor('editor').setEnabled();
            enableBtn();
        }

        function getText() {
            //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
            var range = UE.getEditor('editor').selection.getRange();
            range.select();
            var txt = UE.getEditor('editor').selection.getText();
            alert(txt)
        }

        function getContentTxt() {
            var arr = [];
            arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
            arr.push("编辑器的纯文本内容为：");
            arr.push(UE.getEditor('editor').getContentTxt());
            alert(arr.join("\n"));
        }

        function hasContent() {
            var arr = [];
            arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
            arr.push("判断结果为：");
            arr.push(UE.getEditor('editor').hasContents());
            alert(arr.join("\n"));
        }

        function setFocus() {
            UE.getEditor('editor').focus();
        }

        function deleteEditor() {
            disableBtn();
            UE.getEditor('editor').destroy();
        }

        function disableBtn(str) {
            var div = document.getElementById('btns');
            var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
            for (var i = 0, btn; btn = btns[i++];) {
                if (btn.id == str) {
                    UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
                } else {
                    btn.setAttribute("disabled", "true");
                }
            }
        }

        function enableBtn() {
            var div = document.getElementById('btns');
            var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
            for (var i = 0, btn; btn = btns[i++];) {
                UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
            }
        }

        function getLocalData() {
            alert(UE.getEditor('editor').execCommand("getlocaldata"));
        }

        function clearLocalData() {
            UE.getEditor('editor').execCommand("clearlocaldata");
            alert("已清空草稿箱")
        }
    </script>
</body>
</html>